Conversation
|
It looks like the Travis CI broke support building for Python 2.6, 3.2, 3.3, annoying... I think I have to manually specify the Ubuntu distribution for these Python versions |
|
@mifi I still haven't dug into the travis-ci error, so any help to get this moving is greatly appreciated! Also if you could write an automated test that uses I think the integration test could be done pretty easily, here's some pseudo code: const isRunning = require('is-running');
async function test() {
// to do an automated test for this, we need to run our JS code in another process
// so that when that process exits, we can test that the Python process is still running.
const processPythonPid = await someFunctionThatSpawnAProcess(async () => {
const pythonBridge = require('./');
const python = pythonBridge({detached: true});
await python.exec`import os`;
const pythonPid = python`os.getpid()`;
t.equal(pythonPid, python.pid, 'same pid');
python.ps.unref();
return python.ps.pid;
});
t.assertTrue(await isRunning(processPythonPid), 'python process is still running after nodejs terminated');
process.kill(processPythonPid, 'SIGKILL');
}
function someFunctionThatSpawnAProcess(f) {
// @TODO do we have to write this, or is there an NPM module for this?
}Alternatively, you could launch a detached process for background work from the Python side, which wouldn't require any changes to the Anyway, I'm pretty easy going, so I'd love to know your thoughts, or if you found another solution. |
|
I don't think that test would be easy. We could spawn another process through Not sure I follow the alternative solution regarding the Python background process. The Python process is launched by the exact |
Allow setting detached: true on the child process so that we can prevent it from propagating signals from parent